<?php
$dsn = 'mysql:dbname=fang;host=localhost';
$dbuser = 'root';
$password = 'root';

/**
 * 文章表
 * aid int unsigned autoincream 主键ID
 * cid int unsigned default:0 分类ID
 * a_cover_pid int unsigned default:0 文章封面图片ID
 * a_title varchar 80 文章标题
 * a_content text 文章内容
 * a_publisher varchar 40 发布者姓名
 * a_publisher_mid int unsigned default:0 发布者管理员ID
 * a_published datetime 0000-00-00 00:00:00 人工指定创建时间
 * a_created datetime 0000-00-00 00:00:00 记录创建时间
 * a_updated datetime 0000-00-00 00:00:00 记录修改时间
 * a_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * a_status tinyint 4 unsinged 状态
 */
$conf['fang_articles'] = array('type' => 'mysql',
                               'dsn' => $dsn,
                               'dbuser' => $dbuser,
                               'password' => $password,
                               'fields' => array(
                                                 'pk' => 'aid',
                                                 'allowed' => array('aid', 'cid', 'a_cover_id', 'a_cover_src', 'a_title', 'a_content', 
                                                                    'a_publisher_mid', 'a_published',
                                                                    'a_created', 'a_updated', 'a_deleted', 'a_status'),
                                                 'required' => array('a_title', 'a_content'),
                                                ),
                              );

/**
 * 分类表
 * cid int unsigned 主键ID
 * c_title varchar 40 分类名
 * c_level tinyint 3 unsigned default:0 分类级别
 * c_link varchar 250 分类外链
 * c_parent_id int unsinged default:0 父类ID
 * c_controller 一级分类对应的控制器名称，用来current
 * c_created datetime 0000-00-00 00:00:00 记录创建时间
 * c_updated datetime 0000-00-00 00:00:00 记录修改时间
 * c_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * c_status tinyint 4 unsinged 状态
 */
$conf['fang_cates'] = array('type' => 'mysql',
                            'dsn' => $dsn,
                            'dbuser' => $dbuser,
                            'password' => $password,
                            'fields' => array(
                                              'pk' => 'cid',
                                              'allowed' => array('cid', 'c_title', 'c_level', 'c_link', 'c_parent_id', 'c_controller',
                                                                 'c_created', 'c_updated', 'c_deleted', 'c_status'),
                                              'required' => array('c_title'),
                                             ),
                           );

/**
 * 店铺简介表
 * i_telphone varchar 250 电话
 * i_address varchar 250 地址
 * i_shopname varchar 250 店名
 * i_indexpic varchar 250 首页图片地址
 * i_contact_id int 联系我们 页面使用的文章ID
 * i_about_ids varchar 250 关于页面 使用的文章ID列表
 * i_created datetime 0000-00-00 00:00:00 记录创建时间
 * i_updated datetime 0000-00-00 00:00:00 记录修改时间
 * i_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * i_status tinyint 4 unsinged 状态
 */
$conf['fang_intro'] = array('type' => 'mysql',
                            'dsn' => $dsn,
                            'dbuser' => $dbuser,
                            'password' => $password,
                            'fields' => array(
                                              'pk' => '',
                                              'allowed' => array('i_telphone', 'i_address', 'i_shopname', 'i_indexpic', 'i_contact_id', 'i_about_ids',
                                                                 'i_news_cid',
                                                                 'i_created', 'i_updated', 'i_deleted', 'i_status'),
                                              'required' => array(),
                                             ),
                           );

/**
 * 管理员表
 * mid int unsigned autoincream 主键id
 * m_handle varchar 40 管理员帐号
 * m_name varchar 40 姓名
 * m_password varchar 64 密码
 * m_email varchar 40 邮箱
 * m_mobile varchar 15 电话
 * m_qq int 11 unsigned QQ
 * m_created datetime 0000-00-00 00:00:00 记录创建时间
 * m_updated datetime 0000-00-00 00:00:00 记录修改时间
 * m_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * m_status tinyint 4 unsinged 状态
 */
$conf['fang_managers'] = array('type' => 'mysql',
                               'dsn' => $dsn,
                               'dbuser' => $dbuser,
                               'password' => $password,
                               'fields' => array(
                                                 'pk' => 'mid',
                                                 'allowed' => array('mid', 'm_handle', 'm_name', 'm_password', 'm_email', 'm_mobile', 'm_qq', 
                                                                    'm_created', 'm_updated', 'm_deleted', 'm_status'),
                                                 'required' => array('m_handle', 'm_name', 'm_password'),
                                                ),
                              );

/**
 * 留言板表 
 * meid int unsigned autoincream 主键id
 * me_nickname varchar 40 昵称
 * me_email varchar 40 邮箱
 * me_mobile varchar 15 手机
 * me_qq int 11 unsigned qq
 * me_content text 
 * me_parent_id int unsigned default:0 父级留言id
 * me_created datetime 0000-00-00 00:00:00 记录创建时间
 * me_updated datetime 0000-00-00 00:00:00 记录修改时间
 * me_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * me_status tinyint 4 unsinged 状态
 */
$conf['fang_messages'] = array('type' => 'mysql',
                               'dsn' => $dsn,
                               'dbuser' => $dbuser,
                               'password' => $password,
                               'fields' => array(
                                                 'pk' => 'meid',
                                                 'allowed' => array('meid', 'me_nickname', 'me_email', 'me_mobile', 'me_qq',
                                                                    'me_content', 'me_parent_id',
                                                                    'me_created', 'me_updated', 'me_deleted', 'me_status'),
                                                 'required' => array('me_nickname', 'me_content'),
                                                ),
                              );

/**
 * 图片表
 * pid int unsigned autoincream 主键ID
 * aid int unsigned
 * p_src varchar 250
 * p_thumb_src varchar 250
 * p_desc varchar 250 图片描述
 * p_created datetime 0000-00-00 00:00:00 记录创建时间
 * p_updated datetime 0000-00-00 00:00:00 记录修改时间
 * p_deleted datetime 0000-00-00 00:00:00 记录删除时间
 * p_status tinyint 4 unsinged 状态
 */
$conf['fang_photos'] = array('type' => 'mysql',
                             'dsn' => $dsn,
                             'dbuser' => $dbuser,
                             'password' => $password,
                             'fields' => array(
                                               'pk' => 'pid',
                                               'allowed' => array('pid', 'aid', 'p_src', 'p_thumb_src', 'p_desc',
                                                                  'p_created', 'p_updated', 'p_deleted', 'p_status'),
                                               'required' => array(),
                                              ),
                            );
